import request from '@/utils/request.js'

export const getHouseList = (params) => {
  return request({
    url: '/house/index',
    method: 'get',
    params
  })
}

export const getHouseInfoList = (data) => {
  return request({
    url: '/house/index?community_code=' + data,
    method: 'get',
  })
}
export const getBuildingInfoList = (data) => {
  return request({
    url: '/house/index?building_code=' + data,
    method: 'get',
  })
}

export const addHouseList = (data) => {
  return request({
    url: '/house/index',
    method: 'post',
    data
  })
}

export const getHouseInfo = (id) => {
  return request({
    url: '/house/index/' + id,
    method: 'get',
  })
}

export const editHoustLoist = (data) => {
  return request({
    url: '/house/index/' + data.id,
    method: 'put',
    data
  })
}

export const delHouseList = (id) => {
  return request({
    url: '/house/index/' + id,
    method: 'delete',
  })
}